#pragma once
#ifndef _SCHWAPI_H_
#define _SCHWAPI_H_

#include <string>
#include <vector>


typedef struct schwapi_interface {
    std::string segment;
    std::vector<std::string> interfaces;
} schwapi_interface;

// 简便硬件抽象层
typedef struct schwapi_device {
    std::string HostId;
    int CaseId;
    int ChassisNumber;
    int ChassisBoardSlotNumber;
    schwapi_interface manageInterface;
    schwapi_interface dataInterface;
} schwapi_device;

// 读取配置文件进行初始化，失败返回-1
int schwapi_init(schwapi_device *dev, const char *configFilePath);
// 返回第一个有效的网段/网卡对应的本机IPv4地址，失败返回空字符串
std::string schwapi_get_interface(schwapi_interface *intf);

#endif
